#ifndef TANK_H
#define TANK_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class tank; }
QT_END_NAMESPACE

class tank : public QMainWindow
{
    Q_OBJECT

public:
    tank(QWidget *parent = nullptr);
    ~tank();
     void paintEvent(QPaintEvent *event);
     void Inittank();
     int ndirection;
     QTimer *mytanktimer;
     QTimer *mybullettimer;
     QTimer *enemytimer;
     QTimer *attacktimer;
     QTimer *updatetimer;
     void keyPressEvent(QKeyEvent *event);
     bool start;
     bool shoot=false;
     struct tanks
     {
         int x,y,direction;
         bool life=false;
     }enemy[4];
     tanks mytank;
     struct bullet
     {
         int x,y,direction;
         bool life=false;
     }bullet[100];
     void create_enemy();

private slots:

     void attack();
     void tank_update();
     void bullet_update();
     void enemy_update();
private:

    Ui::tank *ui;
};
#endif // TANK_H
